<link rel="stylesheet" href="<?=$this->baseUrl()?>/css/main.calendar.css" />
<div id="title"><?=$this->month.' '.$this->year?></div>
<table>
<tr>
    <th class="name">Sun</th>
    <th class="name">Mon</th>
    <th class="name">Tue</th>
    <th class="name">Wed</th>
    <th class="name">Thu</th>
    <th class="name">Fri</th>
    <th class="name">Sat</th>
</tr>
<?php
    for($i=1-$this->first,$s=0;$i<=$this->numofdays;$i++,$s++){
        if($s%7==0) echo "<tr>\n";
        if($i<1)
            echo "<td class='empty'>&nbsp;</td>\n";
        else
            echo "<td".(($this->occupied[$i])?" class='occupied'":"").">$i</td>\n";
        if($s%7==6 || $i==$this->numofdays) echo "</tr>\n";
    }
?>
</table>